package jp.ne.hatena.d.digitalsoul.warikan.repositories

import jp.ne.hatena.d.digitalsoul.warikan.models._

object PartyRepository {
	
	var parties = Map[Int, Party]()
	
	def nextId:Int = parties.size + 1
	
	def add(party:Party) = parties += (party.id -> party)
	
	def exists(id:Int):Boolean = parties.contains(id)
	
	def forPartyId(id:Int):Party = parties(id)
	
	def initialize = parties = Map[Int, Party]()
	
	def forAll:List[Party] = parties.values.toList
	
}